/*
 * @Author: HeAo
 * @Date: 2021-11-01 09:20:15
 * @LastEditTime: 2021-11-01 10:04:58
 * @LastEditors: HeAo
 * @Description:
 * @FilePath: \web2103-2105\web2103code\4-1-Nodejs\day02\1-question.js
 * 别乱动！
 */
let axios = require('axios')
let fs = require('fs')

console.log('begin');

// I/O操作
axios.get('http://121.199.29.84:8002/index/findAllCategory')
  .then(res => {
    console.log('网络请求', res.data.status);
  })

fs.readFile('./a.txt', (err, buffer) => {
  console.log('文件操作io', buffer);
})

setTimeout(() => {
  console.log('超时调用');
}, 1000)

setImmediate(() => {
  console.log('setImmediate');
})

// 微任务
Promise.resolve().then(() => {
  console.log('承诺成功');
})

process.nextTick(() => {
  console.log('nextTick');
})

  ; (function () {
    console.log('立即执行函数');
  })()

console.log('end');